var  mysql=require('mysql');
var url=require('url');
var client=mysql.createConnection({
        host:'localhost',
        user:'root',
        password:'pxh1209.',
        database:'dnf',
        port:'3306'
});
client.connect();
client.query('use test');
var http=require('http');
http.createServer(
function(req,res) {
var da='';
res.writeHeader(200,{'Content-Type':'text/tml','Access-Control-Allow-Origin': '*'});
client.query('select * from lol',function(err,data,fil) {
                for(var i=0;i<data.length;i++)
                {
                        da+=data[i].id+" "+data[i].name+" "+data[i].url+" "+data[i].alexa+" "+data[i].country;
                }
                res.write(da);
                res.end();        
});
}).listen(3000);
